package com.weiqiao.api.rest;

import com.weiqiao.api.domain.ApiResponseEntity;
import com.weiqiao.api.domain.StrategyApiEntity;
import com.weiqiao.api.domain.vo.StrategyApiVO;
import com.weiqiao.api.service.IStrategyApiService;

import com.weiqiao.api.until.ApiResUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("mallApi/core/api/")
public class StrategyApiController {

    @Autowired
    private IStrategyApiService strategyservice;

    /**
     * 获取攻略列表
     *
     * @param vo
     * @return
     */
    @GetMapping("strategy-list")
    public ApiResponseEntity strategyList(@Validated StrategyApiVO vo) {
        List<StrategyApiEntity> list = strategyservice.strategyList(vo);
        return ApiResUtil.buildRes(true, "攻略列表", list);
    }

}
